<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
<input type="button" value="keyi" @click="doit(1)">
    <input type="text" @keyup.enter="doq">
</div>

<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
<script>
    var app=new Vue({
        el:"#app",
        data:{

        },
        methods:{
            doit:function (p1) {
                console.log("ke")
                console.log(p1)
            },
            doq:function () {
              alert("吃了吗")
            }
        }

    })

</script>
</body>
</html>